/**
 * @file 报表展示mock数据
 * @author caierwei(caierwei@baijia.com)
 * @date 2020-01-14
 */

const { mock } = require('mockjs');

const result1 = require('./json/windControl/partOne.json');

const result2 = require('./json/windControl/partTwo.json');

const result3 = require('./json/windControl/partThree.json');

const result4 = require('./json/windControl/partFour.json');

const result5 = require('./json/windControl/partFive.json');

const result6 = require('./json/windControl/partSix.json');

const result7 = {
    "code": 0,
    "data": {
        "allUnitType": {
            "cardList": null,
            "lineUnit": null,
            "barUnit": null,
            "compositeUnit": null,
            "pieUnit": null,
            "textList": [
                {
                    "unitId": "RiskControlTitle_text_1",
                    "unitName": "文本",
                    "textContent": "每日8点更新昨日数据，相关问题请联系经营分析----【孟宸】"
                },
                {
                    "unitId": "RiskControlTitle_text_2",
                    "unitName": "文本",
                    "textContent": "数据更新至:2021-02-01"
                }
            ],
            "picture": null,
            "simpleExcel": null,
            "excelList": null
        }
    },
    "msg": "success",
    "pager": null
}

module.exports = {
  'POST /api/riskControl/values': (req, res) => {
        if (req.body.part === 1) {
            return res.json(mock(result1));
        }
        if (req.body.part === 2) {
            return res.json(mock(result2));
        }
        if (req.body.part === 3) {
            return res.json(mock(result3));
        }
        if (req.body.part === 4) {
            return res.json(mock(result4));
        }
        if (req.body.part === 5) {
            return res.json(mock(result5));
        }
        if (req.body.part === 6) {
            return res.json(mock(result6));
        }
        if (req.body.part === 7) {
            return res.json(mock(result7));
        }
  },
  'POST /api/riskControl/select': mock(
    {
      'code': 0,
      'msg': null,
      'data': [
        'aaaa', 'bbbbb', 'cccc'
      ],
      'pager': {
        "pageNum": 1,
        "pageSize": 50,
        "count": 100,
      }
    }
  ),
  'POST /api/riskControl/download': mock({
    'code': 0,
    'msg': null,
    'data': null,
    'pager': {
      "pageNum": 1,
      "pageSize": 50,
      "count": 100
    }
  }),
  'POST /api/riskControl/detail':
  {"code":0,"data":{"columnList":[{"id":"count(*)","name":"订单量"},{"id":"first_classify_name","name":"渠道一级分类"}],"value":[{"订单量":"273402","渠道一级分类":"信息流"},{"订单量":"76972","渠道一级分类":"淘金"},{"订单量":"38653","渠道一级分类":"公众号"},{"订单量":"333127","渠道一级分类":"商务渠道"},{"订单量":"88407","渠道一级分类":"内部渠道"}]},"msg":"success","pager":null}
};
